package com.zs.mp;

import java.util.stream.Stream;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import com.zs.mp.annotation.EnableLog;
import com.zs.mp.cusfb.CusFactoryBean;
import com.zs.mp.imports.MyLog;

@SpringBootApplication
@MapperScan("com.zs.mp.dao")
//@EnableLog
public class PrezsMpApplication {

	public static void main(String[] args) {
		ConfigurableApplicationContext context = SpringApplication.run(PrezsMpApplication.class, args);
		
//		MyLog myLog = context.getBean(MyLog.class);
//		System.out.println(myLog);
//		myLog.customizationLog();
		
//		Stream.of(context.getBeanDefinitionNames()).forEach(System.out::println);
		
		CusFactoryBean bean = context.getBean(CusFactoryBean.class);
		System.out.println(bean.getObjectType().getName());
		Object bean1 = context.getBean("cusFactoryBean");
		System.out.println(bean1);
		Object bean2 = context.getBean(MyLog.class);
		System.out.println(bean2);
		Object bean3 = context.getBean("&cusFactoryBean");
		System.out.println(bean3);
	}

}
